package com.lianxi

import java.util.Scanner

/**
  * Created by adengdeng on 2017/8/8 
  */
object Lx4 {

  def main(args: Array[String]): Unit = {
    val map = new scala.collection.mutable.LinkedHashMap[String,Int]
    val in = new Scanner(new java.io.File("myfile.txt"))
    while (in.hasNext()){
      val str = in.next()
      map(str) = map.getOrElse(str, 0) + 1
    }

    println(map.mkString(" "))
  }
}
